import 'package:love_newf/generated/json/base/json_convert_content.dart';
import 'package:love_newf/app/com/model/friend_user_info_model.dart';

FriendUserInfoModel $FriendUserInfoModelFromJson(Map<String, dynamic> json) {
  final FriendUserInfoModel friendUserInfoModel = FriendUserInfoModel();
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    friendUserInfoModel.userId = userId;
  }
  final String? userCode = jsonConvert.convert<String>(json['userCode']);
  if (userCode != null) {
    friendUserInfoModel.userCode = userCode;
  }
  final String? nick = jsonConvert.convert<String>(json['nick']);
  if (nick != null) {
    friendUserInfoModel.nick = nick;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    friendUserInfoModel.avatar = avatar;
  }
  final int? sex = jsonConvert.convert<int>(json['sex']);
  if (sex != null) {
    friendUserInfoModel.sex = sex;
  }
  final int? age = jsonConvert.convert<int>(json['age']);
  if (age != null) {
    friendUserInfoModel.age = age;
  }
  final String? province = jsonConvert.convert<String>(json['province']);
  if (province != null) {
    friendUserInfoModel.province = province;
  }
  final String? introduction = jsonConvert.convert<String>(
      json['introduction']);
  if (introduction != null) {
    friendUserInfoModel.introduction = introduction;
  }
  final String? bindTime = jsonConvert.convert<String>(json['bindTime']);
  if (bindTime != null) {
    friendUserInfoModel.bindTime = bindTime;
  }
  final int? living = jsonConvert.convert<int>(json['living']);
  if (living != null) {
    friendUserInfoModel.living = living;
  }
  final int? online = jsonConvert.convert<int>(json['online']);
  if (online != null) {
    friendUserInfoModel.online = online;
  }
  final int? loversGrade = jsonConvert.convert<int>(json['loversGrade']);
  if (loversGrade != null) {
    friendUserInfoModel.loversGrade = loversGrade;
  }
  final int? tokens = jsonConvert.convert<int>(json['tokens']);
  if (tokens != null) {
    friendUserInfoModel.tokens = tokens;
  }
  final int? friendType = jsonConvert.convert<int>(json['friendType']);
  if (friendType != null) {
    friendUserInfoModel.friendType = friendType;
  }
  final int? roomType = jsonConvert.convert<int>(json['roomType']);
  if (roomType != null) {
    friendUserInfoModel.roomType = roomType;
  }
  final int? roomId = jsonConvert.convert<int>(json['roomId']);
  if (roomId != null) {
    friendUserInfoModel.roomId = roomId;
  }
  final int? expireTime = jsonConvert.convert<int>(json['expireTime']);
  if (expireTime != null) {
    friendUserInfoModel.expireTime = expireTime;
  }
  final int? expireTokens = jsonConvert.convert<int>(json['expireTokens']);
  if (expireTokens != null) {
    friendUserInfoModel.expireTokens = expireTokens;
  }
  final int? isFriend = jsonConvert.convert<int>(json['isFriend']);
  if (isFriend != null) {
    friendUserInfoModel.isFriend = isFriend;
  }
  return friendUserInfoModel;
}

Map<String, dynamic> $FriendUserInfoModelToJson(FriendUserInfoModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['userCode'] = entity.userCode;
  data['nick'] = entity.nick;
  data['avatar'] = entity.avatar;
  data['sex'] = entity.sex;
  data['age'] = entity.age;
  data['province'] = entity.province;
  data['introduction'] = entity.introduction;
  data['bindTime'] = entity.bindTime;
  data['living'] = entity.living;
  data['online'] = entity.online;
  data['loversGrade'] = entity.loversGrade;
  data['tokens'] = entity.tokens;
  data['friendType'] = entity.friendType;
  data['roomType'] = entity.roomType;
  data['roomId'] = entity.roomId;
  data['expireTime'] = entity.expireTime;
  data['expireTokens'] = entity.expireTokens;
  data['isFriend'] = entity.isFriend;
  return data;
}

extension FriendUserInfoModelExtension on FriendUserInfoModel {
  FriendUserInfoModel copyWith({
    int? userId,
    String? userCode,
    String? nick,
    String? avatar,
    int? sex,
    int? age,
    String? province,
    String? introduction,
    String? bindTime,
    int? living,
    int? online,
    int? loversGrade,
    int? tokens,
    int? friendType,
    int? roomType,
    int? roomId,
    int? expireTime,
    int? expireTokens,
    int? isFriend,
  }) {
    return FriendUserInfoModel()
      ..userId = userId ?? this.userId
      ..userCode = userCode ?? this.userCode
      ..nick = nick ?? this.nick
      ..avatar = avatar ?? this.avatar
      ..sex = sex ?? this.sex
      ..age = age ?? this.age
      ..province = province ?? this.province
      ..introduction = introduction ?? this.introduction
      ..bindTime = bindTime ?? this.bindTime
      ..living = living ?? this.living
      ..online = online ?? this.online
      ..loversGrade = loversGrade ?? this.loversGrade
      ..tokens = tokens ?? this.tokens
      ..friendType = friendType ?? this.friendType
      ..roomType = roomType ?? this.roomType
      ..roomId = roomId ?? this.roomId
      ..expireTime = expireTime ?? this.expireTime
      ..expireTokens = expireTokens ?? this.expireTokens
      ..isFriend = isFriend ?? this.isFriend;
  }
}